﻿@model WebApplication.Models.ReportModel

@{
    ViewBag.Title = "Add";
}

<h2>Добавление нового отчета</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend></legend>
        @if (ViewData["errors"] != null)
        {
            <div class="alert alert-error">
                <p>@ViewData["errors"]</p>
            </div>
        }
    @*    @Html.HiddenFor(t => t.id)*@

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Settings)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Settings)
            @Html.ValidationMessageFor(model => model.Settings)
        </div>

        <p>
            <input type="submit" value="Добавить" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Назад к списку отчетов", "Index")
</div>
